% function quick_cal_bcoe(el,cvd)
% % function quick_cal_bcoe(el,cvd)
% % el is the  eyelink default structure
% % cvd is Calibrate, Validate, or Driftcorrect
% if nargin<2
%     help(mfilename)
%     return
% end
if eyelink('initialize') ~= 0
    button = questdlg_offscreen('eyelink is not connecting','no EL1K','exit','DUMMY mode','DUMMY mode');
    if button(1)=='D'
        eyelink('initializedummy');
    else
        disp('program exited by user')
        return
    end
end

try
Screen('Preference', 'VisualDebuglevel', 3); % 4 is default but it makes a painful white screen
Screen('Preference', 'VisualDebuglevel', 1); % 4 is default but it makes a painful white screen
[w,screenRect] = SCREEN('OpenWindow',2);
el=EyelinkInitDefaults(w);
el.backgroundcolour=0;
el.foregroundcolour=.8*255;
ListenChar(2)
err=EyelinkDoTrackerSetup(el,el.ENTER_KEY);
%err=EyelinkDoTrackerSetup_bcoe(el,'c');
ListenChar(0)
disp('succesful exit')
catch this
    shit
end
shit